<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="com.lrkj.back.entity.TbEmployee" %>
<%@ include file="../attr.jsp" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<% Object userName = request.getSession().getAttribute("userName");
    if(userName ==null){
        TbEmployee tb = (TbEmployee) request.getSession().getAttribute("emp");
        if (tb == null) {
            response.sendRedirect("/");
        }

    }
%>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
    <%@ include file="../css.jsp" %>
    <link rel="stylesheet" type="text/css" href="${ctx}/css/index.css" />

<title>消毒供应中心信息系统</title>
</head>

<body>
<div id="container">
    <div id="hd">
        <div class="hd-wrap clearfix">
            <div class="top-light"></div>
            <h1 class="logo"></h1>
            <ul class="main-nav clearfix">
                <c:forEach items="${firstMenu}" var="menu" varStatus="inx">
                    <c:if test="${inx.index==0}">
                        <li class="current" data-src="/page/${menu.moduleUrl}"><a href="javascript:;">${menu.moduleName}</a></li>
                    </c:if>
                    <c:if test="${inx.index!=0}">
                        <li data-src="/page/${menu.moduleUrl}"><a href="javascript:;">${menu.moduleName}</a></li>
                    </c:if>
                </c:forEach>
                <!--
                <li class="current" data-src="/page/system/index.jsp"><a href="javascript:;">首页</a></li>
                <li data-src="/page/huishou/index.jsp"><a href="javascript:;">回收</a></li>
                <li data-src="/page/qxxd/index.jsp"><a href="javascript:;">清洗消毒</a></li>
                <li data-src="/page/peibao/index.jsp"><a href="javascript:;">配包</a></li>
                <li data-src="/page/mj/index.jsp"><a href="javascript:;">灭菌</a></li>
                <li data-src="/page/wupinfafang/index.jsp"><a href="javascript:;">物品发放</a></li>
                <li data-src="/page/peizhi/index.jsp"><a href="javascript:;">配置管理</a></li>
                <li data-src="/page/linchuang/index.jsp"><a href="javascript:;">临床科室</a></li>
                <li data-src="/page/tongji/index.jsp"><a href="javascript:;">统计</a></li>
                <li data-src="/page/kucun/index.jsp"><a href="javascript:;">CSSD库存</a></li>
                -->
            </ul>
            <div class="toolbar">
                <div class="login-info clearfix">
                    <div class="welcome clearfix"><span>欢迎您,</span><a href="javascript:;" class="user-name">${sessionScope.emp.employeeName}</a></div>
                    <!-- <div class="login-msg clearfix">
                        <a href="javascript:;" class="msg-txt">消息</a>
                        <a href="javascript:;" class="msg-num">10</a>
                    </div> -->
                </div>
                <div class="tool clearfix">
                    <a href="javascript:;" class="quit-btn exit">退出</a>
                    <!-- <a href="javascript:;" class="help-btn">帮助</a> -->
                </div>
            </div>          
            <div id="tishikuang" style="display:none;margin-left:1400px;margin-top:600px; width:100px;height:100px;position:absolute;background-color:#3385ff;"></div>
        </div>
    </div>
    <div id="bd">
    	<div class="wrap clearfix">
            <c:forEach items="${firstMenu}" var="menu" varStatus="inx">
                <c:if test="${inx.index==0}">
                    <iframe src="/page/${menu.moduleUrl}" id="iframe" width="100%" height="100%" frameborder="0"></iframe>
                    <!-- <li class="current" data-src="/page/${menu.moduleUrl}?id=${menu.moduleId}"><a href="javascript:;">${menu.moduleName}</a></li> -->
                </c:if>
            </c:forEach>

     	<!--<iframe src="/page/system/index.jsp" id="iframe" width="100%" height="100%" frameborder="0"></iframe> -->
 	</div>
 </div>
    <div id="ft" class="clearfix">
    	<div class="ft-left">
            <!-- <span>供应室追溯管理系统</span> -->
            <span>物品追溯</span>
            <em>追溯系统</em>
        </div>
        <div class="ft-right">
            <span>版权所有</span>
            <em>V1.0&nbsp;2016</em>
        </div>
    </div>
</div>
<div class="exitDialog">
	<div class="dialog-content">
    	<div class="ui-dialog-icon"></div>
        <div class="ui-dialog-text">
        	<p class="dialog-content">你确定要退出系统？</p>
            <p class="tips">如果是请点击“确定”，否则点“取消”</p>
            
            <div class="buttons">
                <input type="button" class="button long2 ok" value="确定" />
                <input type="button" class="button long2 normal" value="取消" />
            </div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript" src="${ctx}/js/jquery.js"></script>
<%@ include file="../js.jsp" %>
<script type="text/javascript">


    $(function () {
        

        /**
         * 全局ajax拦截
         */
        $.ajaxSetup({

            complete: function (XMLHttpRequest, status) {
                debugger
                if (XMLHttpRequest.status == 401) {
                    location.href = '${ctx}/index.jsp';
                }
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                if (XMLHttpRequest.status == 401) {
                    location.href = '${ctx}/index.jsp';
                }
            }
        });
    })


    $(document).ready(function () {
        setInterval("check()",6000000);
    });
    function check(){
        $.ajax({
            type: "POST",
            url:"${ctx}/employee/check.do",
            error: function(request) {

            },
            success: function(data) {
                console.log(data);
                if(!isNullOrEmpty(data.str)){
                    $("#tishikuang").animate({opacity:'0.7'},"slow");
                    $("#tishikuang").text("");
                    $("#tishikuang").text(data.str);
                    $("#tishikuang").show();
                    $('#tishikuang').delay(10000).hide(0);
                }
            }
        });
    }
    function isNullOrEmpty(strVal){
        if(strVal !=null ){
            strVal = strVal.replace(/(^\s*)|(\s*$)/g,"");
        }
        if(strVal == '' || strVal == null || strVal == undefined){
            return true;
        }else{
            return false;
        }
    }

</script>
<script type="text/javascript" src="${ctx}/js/jquery.js"></script>
<script type="text/javascript" src="${ctx}/js/sapar.js"></script>
<script type="text/javascript" src="${ctx}/js/index.js"></script>
</body>
</html>
